<template lang="html">
  <div class="integraldetails">
    <Header :HeaderTitle="header_title"></Header>
     <!-- 轮播图 -->
    <carousel :listshuju="lunbotu_list"></carousel>
    <Details :detailsimg="goods" v-on:listenToChildEvent="showMsgFromChild"></Details>
    <ul class="purchase_box">
      <li class="purchase_at" @click="dianjiintegral()">立即兑换</li>
    </ul>
  </div>
</template>

<script type="text/javascript">
	import Header from "../header/header.vue";
  import carousel from "../Carousel/Carousel.vue";
  import details from "../goodsdetails/name.vue";
export default {
  name: 'cuxiao',
  data(){
  	return{
  		header_title:{url:"/",title:"商品详情"},
      goods:{},
      lunbotu_list:[],
      num:1,
  	}
  },
  methods:{
    showMsgFromChild:function(data){
      this.num = data;
    },
    dianjiintegral:function (){
      let conent = this;
      conent.$router.push({path: '/integralorderfrom',query:{id:conent.goods.id,numer:conent.num}});
    },
    integraldetailsshuju:function(boxmain){
      let cur_id = sessionStorage.getItem("cur_id"),
      sign = sessionStorage.getItem("sign"),
      conent = boxmain,
      _url = "/index.php?g=app&m=shopping&a=jifengoods_one_post",
      routerParams = conent.$route.query.id;
      let _data = {
        id:routerParams
      }
      conent.$http.post(_url,_data).then(function(data){
          if(data.data.status== "1"){
            conent.goods =data.data.data.jifengoods_info;
            conent.lunbotu_list =data.data.data.jifengoods_info.img_list.split(",");
          }else {
            
          }
      },function(response){
          conent.$toast(response);
      })
    }
  },
  created:function(){
    let conent = this;
    conent.integraldetailsshuju(conent);
  },
  components:{
  	'Header':Header,
     'carousel':carousel,
     'Details':details
  }
}
</script>

<style scoped lang="less">
@import '../../../assets/less/index.less';
.integraldetails{
  .purchase_box{
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 13.33vw;
    font-size:@h1_font_size;
    color: @color7;
    .purchase_at{
      width: @width;
      height: 12vw;
      line-height: 12vw;
      margin: 0 auto;
      border: solid 0.5vw @color;
      border-radius: 1vw;
      background-color: @color;
      color: #fff;
    }
  }
}
</style>